package com.course.cdspringboot.controller;

import com.course.cdspringboot.mapper.OptionsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/api")
public class OptionsController {
    @Autowired
    OptionsMapper optionsMapper;

    @GetMapping("/major")
    public List<Map<String, Object>> major(){
        return optionsMapper.major();
    }

    @GetMapping("/school")
    public List<Map<String, Object>> school(){
        return optionsMapper.school();
    }

    @GetMapping("/departments")
    public List<Map<String, Object>> departments(){
        return optionsMapper.departments();
    }

    @GetMapping("/teacher_title")
    public List<Map<String, Object>> teacherTitle(){
        return optionsMapper.teacher_title();
    }





}
